<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>圣诞节倒计时</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      background: #ffebcd;
      color: #2e3d49;
      text-align: center;
      padding: 50px;
    }

    .christmas-banner {
      background-color: #ff4444;
      color: white;
      font-size: 36px;
      padding: 20px;
      border-radius: 10px;
      margin-bottom: 20px;
    }

    .countdown {
      font-size: 50px;
      font-weight: bold;
      color: #006400;
    }

    .message {
      font-size: 24px;
      margin-top: 30px;
      color: #d9534f;
    }

    .decorations {
      margin-top: 50px;
      font-size: 40px;
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="christmas-banner">
      圣诞节倒计时
    </div>

    <div class="countdown">
      <p>{{ countdown }}</p>
    </div>

    <div class="message">
      <p>{{ message }}</p>
    </div>

    <div class="decorations">
      🎄🎅🎁
    </div>
  </div>

  <script>
    new Vue({
      el: '#app',
      data: {
        targetDate: new Date('December 25, 2024 00:00:00').getTime(),
        countdown: '',
        message: '等待圣诞节的到来...',
      },
      created() {
        this.updateCountdown();
        setInterval(this.updateCountdown, 1000);
      },
      methods: {
        updateCountdown() {
          const now = new Date().getTime();
          const distance = this.targetDate - now;

          if (distance <= 0) {
            this.countdown = '圣诞节快乐！';
            this.message = '希望你度过一个温馨的圣诞节！';
          } else {
            const days = Math.floor(distance / (1000 * 60 * 60 * 24));
            const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((distance % (1000 * 60)) / 1000);

            this.countdown = `${days} 天 ${hours} 小时 ${minutes} 分钟 ${seconds} 秒`;
            this.message = '距离圣诞节还有一些时间...';
          }
        }
      }
    });
  </script>
</body>
</html>
